// 封装组织架构相关接口

import request from '@/utils/request'

// 获取组织架构列表
export const getDepartmentListApi = (params) => {
  return request({
    url: '/company/department',
    method: 'get',
    params
  })
}

// 获取部门信息
export const getDepartmentInfoApi = (id) => {
  return request({
    url: `/company/department/${id}`,
    method: 'get'
  })
}

// 添加部门
export const addDepartmentApi = (data) => {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}

// 修改部门
export const editDepartmentApi = (data) => {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}

// 删除部门
export const deleteDepartmentApi = (id) => {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}
